﻿/************************************************
*Author: KIM
*Create Time: 2/11/2017 12:05:58
*CLR Version: 4.0.30319.42000
*Description:
*
*Update History:
*
***********************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ACC.Extensions.Utilities
{
    public static class ObjectExtension
    {
        public static int ToInt(this object obj)
        {
            if(obj == null)
            {
                return 0;
            }
            int value = 0;
            int.TryParse(obj.ToString(), out value);
            return value;
        }

        public static double ToDouble(this object obj)
        {
            if(obj == null)
            {
                return 0;
            }
            double value = 0;
            double.TryParse(obj.ToString(), out value);
            return value;
        }
    }
}
